<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
set_time_limit(0);
$arrLang = array("big5", "iso-8859-1", "gb2312");
$arrGroup = array("member", "admin");
$_SERVER["DOCUMENT_ROOT"] = "/var/www/lottou";
print date("Y-m-d H:i:s")."<br>\n";
for($i = 0; $i < sizeof($arrLang); $i++){
	for($j = 0; $j < sizeof($arrGroup); $j++){
		$strLangFile = $_SERVER["DOCUMENT_ROOT"]."/language/".$arrLang[$i]."_".$arrGroup[$j].".inc.php";
		print "<br>\n<br>\n".$strLangFile."<br>\n";
		if(file_exists($strLangFile)){
			$arrCon = file($strLangFile);
			$strCon = join("", $arrCon);
			$arrCon = split("Array", $strCon);

			if(preg_match("/\/\/==The Same Language==\/\/(.+)\/\/==The Same Language End==\/\//s", $arrCon[0], $d)){
				$strTheSame = trim($d[1]);
			}else{
				print "The Same Language is Not Exit!!\n";
				continue;
			}
			while(list($k, $v) = each($arrCon)){
				if(preg_match("/\/\/==(.+)==\/\/(.+)\/\/==End==\/\//s", $v, $d)){
					if(!empty($d[1])){
						$strMakeFile = $_SERVER["DOCUMENT_ROOT"]."/language/lang_".$arrGroup[$j]."/".$d[1]."_".($i+1).".lang.php";
						$fp = fopen($strMakeFile, "w+");
						fputs($fp, "<"."?"."php\n".$strTheSame."\n\n".$d[2]."?".">");
						fclose($fp);
						print $d[1]."_".($i+1).".lang.php  OK!!<br>\n";
					}
				}
			}
		}
		$strMakeFile = $_SERVER["DOCUMENT_ROOT"]."/language/lang_".$arrGroup[$j]."/thesame_".($i+1).".lang.php";
		$fp = fopen($strMakeFile, "w+");
		fputs($fp, "<"."?"."php\n".$strTheSame."\n\n"."?".">");
		fclose($fp);
		print "thesame_".($i+1).".lang.php  OK!!<br>\n";
	}
}
?>Make OK!